package com.xin.di.uav.common.utils;

import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Component;

import java.util.*;

@Component
@RequiredArgsConstructor
public class BatchDecryptionUtils {
    private final PhoneEncoderUtil phoneEncoderUtil;
    public Map<String,String> batchDecryption(List<String> phoneList) {
        Set<String> phoneSet = new HashSet<>(phoneList);
        HashMap<String,String> allPhoneEncrypAndDecrypHashMap = new HashMap<>(10);
        phoneSet.forEach(phone-> allPhoneEncrypAndDecrypHashMap.put(phone,phoneEncoderUtil.decryptString(phone)));
        return  allPhoneEncrypAndDecrypHashMap;
    }
}
